<?php
include("db/connect.php");
include("prename.php");
$sqlselectemployee="select * from employee,province,amphur,tambol";
$sqlselectemployee.=" where employee.province_id=province.province_id and";
$sqlselectemployee.=" employee.amphur_id=amphur.amphur_id and";
$sqlselectemployee.=" employee.tambol_id=tambol.tambol_id and";
$sqlselectemployee.=" emp_id like '%".$_POST["txtsearch"]."%' group by emp_id";
$queryselectemployee=mysql_query($sqlselectemployee);
?>
<table width="100%" height="132" border="0" class="tb_list_employee">
<thead>
  <tr>
  	<th width="25%">ชื่อ-นามสกุล</th>
    <th width="40%">ที่อยู่</th>
    <th width="13%">รหัสไปรษณีย์</th>
    <th width="13%">เบอร์โทรศัพท์</th>
    <th width="7%">Email</th>
    <th width="7%">แก้ไข</th>
    <th width="6%">ลบ</th>
  </tr>
  </thead>
  <tbody style="color:black !important;">
  <?php 
  while($resultemployee=mysql_fetch_array($queryselectemployee)){
  ?>
  <tr>
  	<td><?php echo prename($resultemployee["emp_title"])." ".$resultemployee["emp_name"]." ".$resultemployee["emp_lastname"]?></td>
    <td><?php echo $resultemployee["emp_addr"]." ".$resultemployee["tambol_name"]." ".$resultemployee["amphur_name"]." ".$resultemployee["province_name"]?></td>
    <td><?php echo $resultemployee["emp_postal"]?></td>
    <td><?php echo $resultemployee["emp_tel"]?></td>
    <td><?php echo $resultemployee["emp_mail"]?></td>
    <td><a href="Javascript:ajaxmanage(2,<?php echo $resultemployee["emp_id"];?>);">แก้ไข</a></td>
    <td><a href="Javascript:ajaxmanage(1,<?php echo $resultemployee["emp_id"];?>);"onclick="return window.confirm('ต้องการลบใช่ไหม')">ลบ</a></td>
  </tr>
  <?php }?>
   </tbody>
</table>
<script>
$(document).ready(function(){

  	var oTable3 = $('.tb_list_employee').dataTable({
          "bJQueryUI": true,
          "sPaginationType": "full_numbers"
      });
});
	  
	
</script>

